package com.jzcn.common.file;


import java.text.SimpleDateFormat;
import java.util.Date;

public class RelativePathGenerator {

    private RelativePathGenerator() {

    }

    public static String generate(String fileName,  String fileSuffix, Date date) {
        return RelativePathGenerator.generatePath( date) + fileName + "." + fileSuffix;
    }

    public static String generate(String fileName, String fileSuffix, Integer fileSize, Date date) {
        return RelativePathGenerator.generatePath( date) + fileName + "-" + fileSize + "." + fileSuffix;
    }

    private static String generatePath(Date date) {
        return "/" +  new SimpleDateFormat("yyyy-MM-dd").format(date) + "/";
    }
}
